home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.02 Feb 91 / xserial source ƒ / xcmd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-27  |  1.4 KB  |  80 lines  |  [TEXT/KAHL]

  1. #include    <PrintMgr.h>
  2. /* define XTEST for callbacks to be imitated in C code */
  3. #define    XTEST
  4.  
  5. /* define FOX for for xcmds to be used in FoxBase environment */
  6. #define    FOX
  7.  
  8.  
  9. typedef struct
  10.     {
  11.     short    paramCount;
  12.     Handle    params[16];
  13.     Handle    returnValue;
  14.     short    passflag;
  15.     void    (*entryPoint)();
  16.     short    request;
  17.     short    result;
  18.     long    inArgs[8];
  19.     long    outArgs[4];
  20.     
  21. #ifdef FOX
  22.     /* these fields of the XCMD parameter block used only in
  23.      * foxbase
  24.      */
  25.     short        version;
  26.     short        options;
  27.     WindowPtr    onscreen;
  28.     GrafPtr        offscreen;
  29.     THPrint        PrintRec;
  30.     TPPrPort    printPort;
  31.     short        foxuser;
  32.     short        setresource;
  33.     long        utillong1;
  34.     long        utillong2;
  35.     long        utillong3;
  36.     long        utillong4;
  37.     Handle        utilhandle1;
  38.     Handle        utilhandle2;
  39.     Handle        utilhandle3;
  40.     Handle        utilhandle4;
  41.     long        publong;
  42.     Handle        pubhandle;
  43.     long        reserved1;
  44.     long        reserved2;
  45. #endif
  46.  
  47.     }
  48.     
  49.     XCmdBlock, *XCmdBlockPtr;
  50.     
  51. #define    errorFlag    (short)        -1
  52. #define    NIL            (Handle)     0
  53. #define    True        (short)        1
  54. #define    False        (short)        0
  55.  
  56. /* useful key names */
  57.  
  58. #define    TAB        9
  59. #define    CR        13
  60. #define    LF        10
  61.  
  62. /* function prototypes for test routines */
  63. void    xpars(XCmdBlock*,...);
  64.  
  65. /* function prototypes for xcmd routines */
  66.  
  67. long    HandleToNum(XCmdBlockPtr,Handle);
  68. char    *ctop(char *);
  69. char    *ptoc(char *);
  70. void    setreturn(XCmdBlockPtr,char *);
  71. Handle    CopyStrToHand(char *);
  72.  
  73.  
  74. /* function prototypes for call back routines */
  75. pascal long        StrToLong(XCmdBlockPtr,char *);
  76.  
  77.  
  78. /* defines for call back routines */
  79.  
  80. #define    xreqStrToLong        9